namespace NHCodeFirst.Tests.Entities
{
    public class EntityBase
    {
        public virtual long ID { get; protected set; }


        public override bool Equals(object obj)
        {
            if (this == obj)
                return true;
            var entityObject = obj as EntityBase;
            if (entityObject == null)
                return false;
            return ID == entityObject.ID;
        }

        public override int GetHashCode()
        {
            unchecked
            {
                var result = ID.GetHashCode();
                result = 29*result + base.GetHashCode();
                return result;
            }
        }
    }
}